package com.yun.platform.iot.service;

import com.yun.platform.iot.entity.ProGroupDevice;
import com.yun.platform.iot.mapper.ProGroupDeviceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 项目设备分组关系表 service 
 *  @author: Hanson  2022-11-24
 */
@Service
public class ProGroupDeviceService extends ServiceImpl<ProGroupDeviceMapper, ProGroupDevice> {

    @Autowired
    private ProGroupDeviceMapper proGroupDevicemapper;


    /**
     * 检查分组ID是否存在绑定设备
     * @param groupid
     * @return
     */
    public boolean checkDel(Integer groupid) {
        if(this.lambdaQuery().eq(ProGroupDevice::getGroupId,groupid).count()>0){
            return true;
        }else{
            return false;
        }

    }
}